package TCP.Test2;

import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Test2 {
    public static void main(String[] args) throws Exception{
        Socket socket = new Socket("127.0.0.1",8888);
        //打开输出流发消息
        OutputStream os = socket.getOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(os);
        oos.writeObject(new User(1001,"张三"));
    }
}
